﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PRO.PermissionProvider
{
    public class BasePermission
    {
        private static IPermissionProvider _instance = null;
        private static object lockHelper = new object();
        private BasePermission()
        { }
        /// <summary>
        /// 创建权限管理实例
        /// </summary>
        /// <returns></returns>
        public static IPermissionProvider GetInstance()
        {
            if (_instance == null)
            {
                lock (lockHelper)
                {
                    if (_instance == null)
                        _instance = (IPermissionProvider)Activator.CreateInstance(Type.GetType("PRO.PermissionSQL.PermissionManager,PRO.PermissionSQL", false, true));
                }
            }
            return _instance;
        }
    }
}
